{% load static %}
<!DOCTYPE html>
<html lang="zh">
<head>
    <meta charset="UTF-8">
    <meta name="viewport" content="width=device-width, initial-scale=1.0">
    <title>投票结果 | 投票系统</title>
    <link rel="stylesheet" href="{% static 'polls/style.css' %}">
</head>
<body>
    <div class="container">
        <div class="card results-card">
            <h1>投票结果</h1>
            <h2>{{ question.question_text }}</h2>

            <div class="results-list">
                {% for choice in question.choice_set.all %}
                    <div class="result-item">
                        <div class="result-info">
                            <span class="choice-text">{{ choice.choice_text }}</span>
                            <span class="vote-count">{{ choice.votes }} 票</span>
                        </div>
                        <div class="progress-container">
                            <div class="progress-bar" style="width: {% widthratio choice.votes question.choice_set.all|length 100 %}%"></div>
                        </div>
                    </div>
                {% endfor %}
            </div>

            <div class="nav-links">
                <a href="{% url 'polls:index' %}" class="btn secondary">返回首页</a>
                <a href="{% url 'polls:detail' question.id %}" class="btn primary">再次投票</a>
            </div>
        </div>
    </div>
</body>
</html>